// auth mailer
#![allow(non_upper_case_globals)]

use loco_rs::prelude::*;

use crate::models::users;

#[allow(clippy::module_name_repetitions)]
pub struct AuthMailer {}
impl Mailer for AuthMailer {}
impl AuthMailer {
    /// Sending welcome email the the given user
    ///
    /// # Errors
    ///
    /// When email sending is failed
    pub async fn send_welcome(_ctx: &AppContext, _user: &users::Model) -> Result<()> {
        // 暂时返回错误，因为邮件模板不可用
        Err(Error::string("Email templates not available in workspace mode"))
    }

    /// Sending forgot password email
    ///
    /// # Errors
    ///
    /// When email sending is failed
    pub async fn forgot_password(_ctx: &AppContext, _user: &users::Model) -> Result<()> {
        // 暂时返回错误，因为邮件模板不可用
        Err(Error::string("Email templates not available in workspace mode"))
    }

    /// Sends a magic link authentication email to the user.
    ///
    /// # Errors
    ///
    /// When email sending is failed
    pub async fn send_magic_link(_ctx: &AppContext, _user: &users::Model) -> Result<()> {
        // 暂时返回错误，因为邮件模板不可用
        Err(Error::string("Email templates not available in workspace mode"))
    }
}